<style lang="scss" scoped>
.createpic {
  .main {
    width: 50%;
    margin: 0 25% 0 25%;
    .head {
      margin: 30px 0 30px 0;
    }
  }
}
</style>

<style>
.el-input .el-input__inner {
  width: 350px;
}
.el-textarea .el-textarea__inner {
  width: 350px;
}
</style>
<template>
  <div class="createpic">
    <div class="main">
      <div class="head">新建相册</div>
      <el-form label-width="80px" :model="List">
        <el-form-item label="相册编号:">
          <el-input v-model="List.id"></el-input>
        </el-form-item>
        <el-form-item label="相册名称:">
          <el-input v-model="List.name"></el-input>
        </el-form-item>
        <el-form-item label="相册描述:">
          <el-input type="textarea" v-model="List.description"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="create()">保存</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>
<script>
import { CreateAblum } from "@/api/assetsdata";
export default {
  data() {
    return {
      List: {
        id: "",
        name: "",
        description: "",
      },
    };
  },

  methods: {
    create() {
      CreateAblum(this.List)
      .then(res => {
        if (res && res.data && res.data.code === 0) {
            this.List= res.data.data;
            this.$message({
              type: "success",
              message: "新增成功，2秒后自动返回",
            });
            setTimeout(() => {
              this.$router.push("/admin/assets/gallery/albumList");
            }, 1500);
          }
          })
        }
  },
 
};
</script>